package com.centaline.androidsalesblog.api.sale;

import com.centaline.androidsalesblog.api.SaleApi;
import com.centaline.androidsalesblog.model.responseobject.SchoolListRo;
import com.centanet.framework.interfaces.IResponseListener;

/**
 * 学校列表
 * Created by guilin on 16/1/11.
 */
public class SchoolListApi extends SaleApi<SchoolListRo> {

    private int startIndex = 0;
    private int gscopeLevel = 0;
    private String gscpid = "";

    public SchoolListApi(Class<?> tag, Class<SchoolListRo> aClass, IResponseListener<SchoolListRo> iResponseListener) {
        super(tag, aClass, iResponseListener);
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public int getStartIndex() {
        return startIndex;
    }

    public void setGscopeLevel(int gscopeLevel) {
        this.gscopeLevel = gscopeLevel;
    }

    public void setGscpid(String gscpid) {
        this.gscpid = gscpid;
    }

    @Override
    protected void setParams() {
        resetParams();
        putParams("startIndex", startIndex);
        putParams("pageCount", 10);
        if (gscopeLevel != 0) {
            putParams("gscopeLevel", gscopeLevel);
            putParams("gscpid", gscpid);
        }
    }

    @Override
    protected String getPath() {
        return "School";
    }
}
